package com.tianji.learning.controller;


import com.tianji.learning.domin.vo.SignRecordVO;
import com.tianji.learning.domin.vo.SignResultVO;
import com.tianji.learning.service.ISignRecordsServer;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api(tags = "签到相关接口")
@RestController
@RequestMapping("sign-records")

@RequiredArgsConstructor
public class SignRecordsController {
    private final ISignRecordsServer signRecordsServer;

    @ApiOperation("签到")
    @PostMapping()
    public SignResultVO sign(){

        return signRecordsServer.sign();
    }

    @ApiOperation("获取签到记录")
    @GetMapping()
    public List<Integer> getSignRecords(){

        return signRecordsServer.getSignRecords();
    }
}
